package com.zhfi.dataapply.schedule.reader.event;

import com.zhfi.dataapply.entity.data.vo.event.EventVO;
import com.zhfi.dataapply.schedule.reader.AbstractRangeDateReader;
import com.zhfi.dataapply.service.CVSourceUrlService;
import com.zhfi.dataapply.service.ForwardService;
import com.zhfi.dataapply.service.common.JobRangeDateService;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class MergeEventReader extends AbstractRangeDateReader<EventVO> {

    private static String URL_ID = "1.2";

    @Getter
    private String url;

    @Autowired
    private CVSourceUrlService cvSourceUrlService;

    @Autowired
    public MergeEventReader(ForwardService forwardService,
                                JobRangeDateService jobRangeDateService) {
        super(EventVO.class, forwardService, jobRangeDateService);
    }

    @Override
    protected String getJobId() {
        return URL_ID;
    }

    @Override
    protected void resetUrl() {
        this.url = cvSourceUrlService.getUrlById(URL_ID);
    }

}
